package com.gdth.widget.dialog;

import java.util.Calendar;

import com.gdth.R;

import android.content.Context;
import android.view.View;
import android.widget.DatePicker;
import android.widget.TextView;

/**
 * 时间选择提示框
 * @author Arvin
 *
 */
public class DialogDateTime extends BaseDialog{
	/**
	 * 选择确定按钮
	 */
	private TextView txt_config;
	
	/**
	 * 时间选择器
	 */
	public DatePicker datePicker;
	
	public DialogDateTime(Context context) {
		super(context, R.style.dialog_theme);
		// TODO Auto-generated constructor stub
		
		initView();
	}
	
	private void initView(){
		super.initView(R.layout.system_dialog_datetime);
		
		txt_config = (TextView) findViewById(R.id.dialog_button_ok);
		
		//取消选择按钮
		TextView txt_cancle = (TextView) findViewById(R.id.dialog_button_cancel);
		txt_cancle.setOnClickListener(new dismissOnClickListener());
		
		datePicker = (DatePicker) findViewById(R.id.date_picker); 
		
		Calendar cal = Calendar.getInstance(); 
        cal.setTimeInMillis(System.currentTimeMillis()); 
        datePicker.init(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), null); 
	}
	
	/**
	 * 设置选择确定事件
	 * @param mOnClickListener
	 */
	public void setOnConfigClickListener(View.OnClickListener mOnClickListener){
		txt_config.setOnClickListener(mOnClickListener);
	}

}
